package com.saris.primego.dao;

import com.saris.primego.pojo.entity.Dish;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DishRepository extends JpaRepository<Dish, Long>, JpaSpecificationExecutor<Dish> {

    List<Dish> findDishesByCategoryId(Long categoryId);

    List<Dish> findAllByCategoryIdAndStatus(Long categoryId, Integer status);

    long countByStatus(Integer status);
}
